import request from './request'
import Vue from 'vue'

const API = {
  // config.noCommon 不使用公共头部设置url及其他
  get(url, params = {}, config = {}) {
    return request.get(url, { params })
  },
  post(url, params = {}, config = {}) {
    return request.post(url, params)
  },
  // 并发 $request.all([getUserAccount(), getUserPermissions()])
  all(all, config) {
    return request.post(all)
  }
}

Vue.prototype.$http = Vue.$http = API
